package net.jxtz.jxtzos.entity.spider;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(exclude = {"id", "createTime"})
public class SpiderBeike implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @ExcelIgnore
    private Integer phase; // 期数

    @ExcelProperty("所在城市")
    private String city;

    @ExcelProperty("区域")
    @TableField("areaCity")
    private String areaCity;

    // 标题
    @ExcelProperty("标题")
    private String title;
    // 成交日期
    @ExcelProperty("成交日期")
    private String date;
    // 户型
    @ExcelProperty("户型")
    @TableField("houseType")
    private String houseType;
    // 所在楼层
    @ExcelProperty("所在楼层")
    private String floor;
    // 总楼层
    @ExcelProperty("总楼层")
    @TableField("allFloor")
    private String allFloor;

    // 面积
    @ExcelProperty("面积（平方米）")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private BigDecimal area;
    // 总价
    @ExcelProperty("总价（万元/平方米）")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private BigDecimal price;
    // 单价
    @ExcelProperty("单价（万元/平方米）")
    @TableField("unitPrice")
    private Integer unitPrice;
    // 装修
    @ExcelProperty("装修")
    private String renovation;
    // 朝向
    @ExcelProperty("朝向")
    private String orientation;
    // 建成年代
    @ExcelProperty("建成年代")
    @TableField("dateOfBuild")
    private Integer dateOfBuild;

    @ExcelProperty("页面url")
    @TableField("pageUrl")
    private String pageUrl;

    @ExcelIgnore
    @TableField("spiderLogId")
    private Long spiderLogId;

    // 创建时间
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT, value = "createTime")
    private Integer createTime;
}
